<template>
  <div >
    <div class="mt10" style=" display: flex;border-bottom: 1px solid #ebedf0;">
      <div class="blue_item" />
      <span class="font15" style="display: flex; line-height: 33px;margin-left:5px;  flex:1;">承办基本信息</span>
    </div>
    <!-- 共有 -->
    <van-field readonly required name="isDecisionMaking" :value="fromdata.isDecisionMaking" label="项目是否标前决策：" label-width="9em" />
    <van-field v-if="fromdata.isDecisionMaking=='是'" readonly required name="decisionMakingTitle" :value="fromdata.decisionMakingTitle" label="标前决策工单标题：" label-width="9em" autosize type="textarea" rows="1"/>
    <van-field v-if="fromdata.isDecisionMaking=='否'" readonly required name="isBid" :value="fromdata.isBid" label="项目是否已投标：" label-width="8em"/>
    <van-field v-if="fromdata.isBid=='是'" readonly required name="tagTitle" :value="fromdata.tagTitle" label="应标管理工单标题：" label-width="9em" autosize type="textarea" rows="1"/>
    <van-field v-if="fromdata.isDecisionMaking=='否'&&fromdata.isBid=='否'" readonly required name="isEnterBusiness" :value="fromdata.isEnterBusiness" label="项目是否录入商机：" label-width="9em"/>
    <van-field v-if="fromdata.isDecisionMaking=='否'&&fromdata.isBid=='否'&&fromdata.isEnterBusiness=='是'" readonly required name="businessTitle" :value="fromdata.businessTitle" label="线索转商机工单标题：" label-width="10em" autosize type="textarea" rows="1"/>
    <van-field readonly required name="businessName" :value="fromdata.businessName" label="商机名称：" label-width="5em" />
    <van-field readonly required name="businessId" :value="fromdata.businessId" label="商机编号：" label-width="5em" />
    <div v-if="fromdata.isDecisionMaking=='是'||fromdata.isBid=='是'||fromdata.isEnterBusiness=='是'">
      <van-field readonly required name="customerCode" :value="fromdata.customerCode" label="客户编码：" label-width="5em" />
      <van-field readonly required name="customerName" :value="fromdata.customerName" label="客户名称：" label-width="5em" />
      <van-field readonly required name="budgetAmount" :value="fromdata.budgetAmount" label="商机预算(万元)：" label-width="8.5em" />
      <van-field readonly required name="budgetTime" :value="fromdata.budgetTime" label="商机录入时间：" label-width="7em" />
      <van-field readonly required name="businessAdvance" :value="fromdata.businessAdvance" label="商机提前量(天)：" label-width="8.5em" />
      <van-field readonly required name="noticeTime" :value="fromdata.noticeTime" label="招标公告日期：" label-width="7em" />
      <van-field readonly required autosize type="textarea" rows="1" name="openDescription" :value="fromdata.openDescription" label="开标项目描述：" label-width="7em" />
      <van-field readonly required name="putRecordCustomerCode" :value="fromdata.putRecordCustomerCode" label="集团客户编码：" label-width="7em" />
      <van-field readonly required name="putRecordCustomerIndustry" :value="fromdata.putRecordCustomerIndustry" label="客户归属行业：" label-width="7em" />
      <van-field readonly required name="isEmphasis" :value="fromdata.isEmphasis" label="是否共性(重点)项目：" label-width="10.5em" />
      <van-field readonly name="emphasisName" :value="fromdata.emphasisName" label="共性(重点)项目名称：" label-width="10.5em" />
      <div class="mt10" style=" display: flex;border-bottom: 1px solid #ebedf0;">
        <div class="blue_item" />
        <span class="font15" style="display: flex; line-height: 33px;margin-left:5px;  flex:1;">集团招标关联信息</span>
      </div>
      <el-table :data="fromdata.tenderingBusinessLinkList" border style="width: 100%">
        <el-table-column prop="linkId" label="招标ID" />
        <el-table-column prop="opportunityNumber" label="已绑定全网商机编码" />
        <el-table-column prop="groupProjectCode" label="已绑定全网项目编码" />
        <el-table-column prop="bindTime" label="商机关联时间" />
      </el-table>
      <!-- 移动中标 -->
      <div v-if="yidongzhongbiao==true">
        <van-field readonly required name="clientFileList" label="客户招标文件：" label-width="7em" />
        <div v-for="(fileitem) in fromdata.clientFileList" :key="fileitem.id"
             style="margin-left:20px">
          <div readonly class="font14 fileLink" style="color:#0F85CF">
            <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
          </div>
        </div>
        <van-field readonly required name="companyFileList" label="公司投标文件：" label-width="7em" />
        <div v-for="(fileitem) in fromdata.companyFileList" :key="fileitem.id"
             style="margin-left:20px">
          <div readonly class="font14 fileLink" style="color:#0F85CF">
            <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
          </div>
        </div>
        <van-field readonly required name="bidPublicityFileList" label="中标公示截图：" label-width="7em" />
        <div v-for="(fileitem) in fromdata.bidPublicityFileList" :key="fileitem.id"
             style="margin-left:20px">
          <div readonly class="font14 fileLink" style="color:#0F85CF">
            <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
          </div>
        </div>
        <van-field readonly required name="isGoodNews" :value="fromdata.isGoodNews" label="是否有喜报：" label-width="6em" />
        <van-field v-if="fromdata.isGoodNews=='是'" readonly required name="goodNewsFileList" label="喜报图片：" label-width="5em" />
        <div v-for="(fileitem) in fromdata.goodNewsFileList" :key="fileitem.id"
             style="margin-left:20px">
          <div readonly class="font14 fileLink" style="color:#0F85CF">
            <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
          </div>
        </div>
        <van-field readonly required name="goodNewsNumber" :value="fromdata.goodNewsNumber" label="喜报展示天数：" label-width="7em" />
        <van-field readonly required name="programManager1" :value="fromdata.programManager1" label="县区方案经理姓名及电话：" label-width="12em" />
        <van-field readonly required name="programManager2" :value="fromdata.programManager2" label="市公司方案经理姓名及电话：" label-width="12em" />
        <van-field readonly required name="accountManager" :value="fromdata.accountManager" label="客户经理姓名及电话：" label-width="10em" />
        <van-field readonly required autosize type="textarea" rows="1" name="content" :value="fromdata.content" label="项目建设内容：" label-width="7em" />
        <van-field readonly required autosize type="textarea" rows="1" name="description" :value="fromdata.description" label="信息化部分说明：" label-width="8em" />
        <van-field readonly required name="lowestPrice" :value="fromdata.lowestPrice" label="最低投标价(万元)：" label-width="9.5em" />
        <van-field readonly required name="estimateHighestCost" :value="fromdata.estimateHighestCost" label="预估最高成本(万元)：" label-width="10.5em" />
        <van-field readonly required name="grossMargin" :value="fromdata.grossMargin" label="项目毛利率（%）：" label-width="8.75em" />
        <van-field readonly required name="estimateMoney" :value="fromdata.estimateMoney" label="预估计收金额（万元）：" label-width="11em" />
        <van-field readonly required name="cooperationMode" :value="fromdata.cooperationMode" label="中移集成合作模式：" label-width="9em" />
        <van-field readonly required name="bidServiceCharge" :value="fromdata.bidServiceCharge" label="实际中标服务费（元）：" label-width="11em" />
        <van-field readonly required name="planSignedDate" :value="fromdata.planSignedDate" label="客户合同签订计划日期：" label-width="11em" />
        <van-field readonly name="pidNotifyFileList" label="中标通知书：" label-width="6em" />
        <div v-for="(fileitem) in fromdata.pidNotifyFileList" :key="fileitem.id"
             style="margin-left:20px">
          <div readonly class="font14 fileLink" style="color:#0F85CF">
            <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
          </div>
        </div>
      </div>
      <!-- 友商中标 -->
      <div v-if="yidongzhongbiao==false">
        <van-field v-if="fromdata.isBid=='是'" readonly required name="registrationFee" :value="fromdata.registrationFee" label="报名费：" label-width="4em" />
        <van-field v-if="fromdata.isBid=='是'" readonly required name="bidPreparationFee" :value="fromdata.bidPreparationFee" label="标书制作费：" label-width="6em" />
        <van-field v-if="fromdata.isBid=='是'" readonly required name="otherBidFee" :value="fromdata.otherBidFee" label="其它投标相关费用：" label-width="9em" />
        <van-field v-if="fromdata.isBid=='是'" readonly required name="bidFiles" label="投标文件：" label-width="5em" />
        <div v-if="fromdata.isBid=='是'" v-for="(fileitem) in fromdata.bidFiles" :key="fileitem.id"
             style="margin-left:20px">
          <div readonly class="font14 fileLink" style="color:#0F85CF">
            <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
          </div>
        </div>
        <van-field readonly required name="isInferiority" :value="fromdata.isInferiority" label="是否能中标：" label-width="6em" />
        <van-field readonly required name="isSection" :value="fromdata.isSection==true?'是':'否'" label="是否分中不同标段：" label-width="9em" />
        <van-field v-if="fromdata.isSection==true" readonly required name="bidProjectName" :value="fromdata.bidProjectName" label="招标项目名称：" label-width="7em" autosize type="textarea" rows="1"/>
        <van-field v-if="fromdata.isSection==true" readonly required name="bidProjectMoney" :value="fromdata.bidProjectMoney" label="中标项目金额：" label-width="7em" />
        <van-field v-if="fromdata.isSection==true" readonly required name="bidProjectDate" :value="fromdata.bidProjectDate" label="中标日期：" label-width="5em" />
      </div>
      <!-- 共有 -->
      <van-field readonly autosize type="textarea" rows="1" name="remarks" :value="fromdata.remarks" label="备注：" label-width="3em" />
      <!-- 移动中标 -->
      <div v-if="yidongzhongbiao==true">
        <div class="mt10" style=" display: flex;border-bottom: 1px solid #ebedf0;">
          <div class="blue_item" />
          <span class="font15" style="display: flex; line-height: 33px;margin-left:5px;  flex:1;">中标复盘</span>
        </div>
        <van-field readonly required autosize type="textarea" rows="1" name="highlights" :value="fromdata.highlights" label="项目亮点：" label-width="5em" />
        <van-field readonly required autosize type="textarea" rows="1" name="empirical" :value="fromdata.empirical" label="经验总结：" label-width="5em" />
      </div>
    </div>
    <div v-else>
      <van-field v-if="fromdata.isSection==true" readonly required name="riskConfirmation" :value="fromdata.riskConfirmation" label="操作风险确认：" label-width="7em" autosize type="textarea" rows="1"/>
      <van-field v-if="fromdata.isSection==true" readonly required name="confirmPerson" :value="fromdata.confirmPerson" label="确认人OA账号：" label-width="7.5em" autosize type="textarea" rows="1"/>
    </div>

    <!-- 友商中标 -->
    <div v-if="yidongzhongbiao==false">
      <div class="mt10" style=" display: flex;border-bottom: 1px solid #ebedf0;">
        <div class="blue_item" />
        <span class="font15" style="display: flex; line-height: 33px;margin-left:5px;  flex:1;">丢标复盘</span>
      </div>
      <van-field readonly required name="isMissing" :value="fromdata.isMissing" label="丢漏单标志：" label-width="6em" />
      <van-field readonly required autosize type="textarea" rows="1" name="missingReason" :value="fromdata.missingReason" label="丢漏单原因：" label-width="6em" />

    </div>
    <div style="padding-bottom: 42px"></div>
  </div>
</template>
<script>
import { openFileUrl } from '@/store/openFile'
export default {
  data() {
    return {
      yidongzhongbiao:false
    }
  },
  props: ['businessdata','fromdata','showHistory','historydata','approveList'],
  created() {
    if(this.fromdata.winPeopleModel=='中国移动'||this.fromdata.winPeopleModel=='集成商'){
      console.log('是否移动中标111111111'+this.fromdata.winPeopleModel)
      this.yidongzhongbiao=true;
    }else {
      console.log('是否移动中标22222222'+this.fromdata.winPeopleModel)
      this.yidongzhongbiao=false;
    }
  },
  methods: {
    openFileUrlfun(value) {
      this.$router.push(
        {
          name: 'fileview',
          query: {
            openFileUrl: openFileUrl(value)
          }
        }
      );
    },
  },
  computed: {

  },
}
</script>
 
<style>
.tables.el-table .cell {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-all;
    line-height: 15px;
    padding-left: 5px;
    padding-right: 5px;
}
</style>